{include file="header.php"}

<h2>{$title}</h2>

<ul class="toolbar clearfix">
	<li><a class="link-button" href="{$site_url}?controller=blog&action=add">Add</a></li>
</ul>

<form action="{$site_url}?controller=blog&action=index" method="post">
	<select name="type" id="type">
		<option value="all">All</option>
		<option value="published">Published</option>
		<option value="unpublished">Unpublished</option>
	</select>
	<input type="submit" name="submit" id="submit" value="Submit" />
</form>

<hr />
<br />

{foreach $blogs as $item}

<h3>
	<a href="{$site_url}?controller=blog&action=view&id={$item.id}">
		{$item.title}
	</a>
</h3>

<div class="date">
	{$item.created}
</div>

<div class="content">
	{$item.content}
</div>

<div>
	<a class="link-button link-button-green" href="{$site_url}?controller=blog&action=edit&id={$item.id}">Edit</a>
	<a class="link-button link-button-red" onclick="confirmDelete({$item.id})" href="#">Delete</a>
</div>

<br />
<hr />
{/foreach}

{include file="footer.php"}